package com.zm.demo.dubbo.sc.consumer;

import com.zm.demo.dubbo.sc.api.UserControllerService;
import com.zm.demo.dubbo.sc.api.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zoum
 * @create 2019/4/28 13:15
 */
@RestController
public class UserController {

    @Reference
    private UserService userService;

    @Reference(timeout = 50000)
    private UserControllerService userControllerService;

    @GetMapping("/hello")
    public String hello(String userName) {
        return userService.hello(userName);
    }

    @GetMapping("/getUserInfo")
    public String getUserInfo(String age, String name){
        return userControllerService.getUserInfo(age, name);
    }
}
